home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 January: Mac OS SDK / Dev.CD Jan 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / CIncludes / PPCToolbox.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-17  |  21.7 KB  |  537 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        PPCToolbox.h
  3.  
  4.      Contains:    Program-Program Communications Toolbox Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1989-1993, 1995-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __PPCTOOLBOX__
  18. #define __PPCTOOLBOX__
  19.  
  20. #ifndef __MACTYPES__
  21. #include <MacTypes.h>
  22. #endif
  23. #ifndef __APPLETALK__
  24. #include <AppleTalk.h>
  25. #endif
  26.  
  27.  
  28.  
  29. #if PRAGMA_ONCE
  30. #pragma once
  31. #endif
  32.  
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36.  
  37. #if PRAGMA_IMPORT
  38. #pragma import on
  39. #endif
  40.  
  41. #if PRAGMA_STRUCT_ALIGN
  42.     #pragma options align=mac68k
  43. #elif PRAGMA_STRUCT_PACKPUSH
  44.     #pragma pack(push, 2)
  45. #elif PRAGMA_STRUCT_PACK
  46.     #pragma pack(2)
  47. #endif
  48.  
  49. typedef unsigned char                     PPCServiceType;
  50.  
  51. enum {
  52.     ppcServiceRealTime            = 1
  53. };
  54.  
  55. typedef short                             PPCLocationKind;
  56.  
  57. enum {
  58.     ppcNoLocation                = 0,                            /* There is no PPCLocName */
  59.     ppcNBPLocation                = 1,                            /* Use AppleTalk NBP      */
  60.     ppcNBPTypeLocation            = 2                                /* Used for specifying a location name type during PPCOpen only */
  61. };
  62.  
  63. typedef short                             PPCPortKinds;
  64.  
  65. enum {
  66.     ppcByCreatorAndType            = 1,                            /* Port type is specified as colloquial Mac creator and type */
  67.     ppcByString                    = 2                                /* Port type is in pascal string format */
  68. };
  69.  
  70. /* Values returned for request field in PPCInform call */
  71. typedef unsigned char                     PPCSessionOrigin;
  72.  
  73. enum {
  74.                                                                 /* Values returned for requestType field in PPCInform call */
  75.     ppcLocalOrigin                = 1,                            /* session originated from this machine */
  76.     ppcRemoteOrigin                = 2                                /* session originated from remote machine */
  77. };
  78.  
  79. typedef short                             PPCPortRefNum;
  80. typedef long                             PPCSessRefNum;
  81.  
  82. struct PPCPortRec {
  83.     ScriptCode                         nameScript;                    /* script of name */
  84.     Str32Field                         name;                        /* name of port as seen in browser */
  85.     PPCPortKinds                     portKindSelector;            /* which variant */
  86.     union {
  87.         Str32                             portTypeStr;            /* pascal type string */
  88.         struct {
  89.             OSType                             portCreator;
  90.             OSType                             portType;
  91.         }                                 port;
  92.     }                                 u;
  93. };
  94. typedef struct PPCPortRec                PPCPortRec;
  95.  
  96. typedef PPCPortRec *                    PPCPortPtr;
  97.  
  98. struct LocationNameRec {
  99.     PPCLocationKind                 locationKindSelector;        /* which variant */
  100.     union {
  101.         EntityName                         nbpEntity;                /* NBP name entity */
  102.         Str32                             nbpType;                /* just the NBP type string, for PPCOpen */
  103.     }                                 u;
  104. };
  105. typedef struct LocationNameRec            LocationNameRec;
  106.  
  107. typedef LocationNameRec *                LocationNamePtr;
  108.  
  109. struct PortInfoRec {
  110.     SInt8                             filler1;
  111.     Boolean                         authRequired;
  112.     PPCPortRec                         name;
  113. };
  114. typedef struct PortInfoRec                PortInfoRec;
  115.  
  116. typedef PortInfoRec *                    PortInfoPtr;
  117. typedef PortInfoRec *                    PortInfoArrayPtr;
  118. typedef union PPCParamBlockRec             PPCParamBlockRec;
  119. typedef PPCParamBlockRec *                PPCParamBlockPtr;
  120. typedef CALLBACK_API( void , PPCCompProcPtr )(PPCParamBlockPtr pb);
  121. typedef STACK_UPP_TYPE(PPCCompProcPtr)                             PPCCompUPP;
  122. #define PPCHeader \
  123.      Ptr            qLink;                   /* PPC's Internal Use */\
  124.      unsigned short csCode;                   /* Requested PPC command */\
  125.      unsigned short intUse;                   /* Internal Use */\
  126.      Ptr            intUsePtr;              /* Internal Use */\
  127.      PPCCompUPP     ioCompletion;            /* 12 --> Completion Routine */\
  128.      OSErr           ioResult;                  /* 16 <-- Command Result Code */\
  129.      unsigned long    Reserved[5];             /* Reserved for PPC, Don't use */
  130.  
  131.  
  132. struct PPCOpenPBRec {
  133.     Ptr                             qLink;                        /* PPC's Internal Use */
  134.     unsigned short                     csCode;                        /* Requested PPC command */
  135.     unsigned short                     intUse;                        /* Internal Use */
  136.     Ptr                             intUsePtr;                    /* Internal Use */
  137.     PPCCompUPP                         ioCompletion;                /* 12 -->    Completion Routine */
  138.     OSErr                             ioResult;                    /* 16 <--     Command Result Code */
  139.     unsigned long                     Reserved[5];                /* Reserved for PPC, Don't use */
  140.     PPCPortRefNum                     portRefNum;                    /* 38 <--   Port Reference */
  141.     long                             filler1;
  142.     PPCServiceType                     serviceType;                /* 44 -->    Bit field describing the requested port service */
  143.     UInt8                             resFlag;                    /* Must be set to 0 */
  144.     PPCPortPtr                         portName;                    /* 46 -->   PortName for PPC */
  145.     LocationNamePtr                 locationName;                /* 50 -->   If NBP Registration is required */
  146.     Boolean                         networkVisible;                /* 54 -->   make this network visible on network */
  147.     Boolean                         nbpRegistered;                /* 55 <--   The given location name was registered on the network */
  148. };
  149. typedef struct PPCOpenPBRec                PPCOpenPBRec;
  150.  
  151. typedef PPCOpenPBRec *                    PPCOpenPBPtr;
  152.  
  153. struct PPCInformPBRec {
  154.     Ptr                             qLink;                        /* PPC's Internal Use */
  155.     unsigned short                     csCode;                        /* Requested PPC command */
  156.     unsigned short                     intUse;                        /* Internal Use */
  157.     Ptr                             intUsePtr;                    /* Internal Use */
  158.     PPCCompUPP                         ioCompletion;                /* 12 -->    Completion Routine */
  159.     OSErr                             ioResult;                    /* 16 <--     Command Result Code */
  160.     unsigned long                     Reserved[5];                /* Reserved for PPC, Don't use */
  161.     PPCPortRefNum                     portRefNum;                    /* 38 -->   Port Identifier */
  162.     PPCSessRefNum                     sessRefNum;                    /* 40 <--   Session Reference */
  163.     PPCServiceType                     serviceType;                /* 44 <--   Status Flags for type of session, local, remote */
  164.     Boolean                         autoAccept;                    /* 45 -->   if true session will be accepted automatically */
  165.     PPCPortPtr                         portName;                    /* 46 -->   Buffer for Source PPCPortRec */
  166.     LocationNamePtr                 locationName;                /* 50 -->   Buffer for Source LocationNameRec */
  167.     StringPtr                         userName;                    /* 54 -->   Buffer for Soure user's name trying to link. */
  168.     unsigned long                     userData;                    /* 58 <--   value included in PPCStart's userData */
  169.     PPCSessionOrigin                 requestType;                /* 62 <--   Local or Network */
  170.     SInt8                             filler;
  171. };
  172. typedef struct PPCInformPBRec            PPCInformPBRec;
  173.  
  174. typedef PPCInformPBRec *                PPCInformPBPtr;
  175.  
  176. struct PPCStartPBRec {
  177.     Ptr                             qLink;                        /* PPC's Internal Use */
  178.     unsigned short                     csCode;                        /* Requested PPC command */
  179.     unsigned short                     intUse;                        /* Internal Use */
  180.     Ptr                             intUsePtr;                    /* Internal Use */
  181.     PPCCompUPP                         ioCompletion;                /* 12 -->    Completion Routine */
  182.     OSErr                             ioResult;                    /* 16 <--     Command Result Code */
  183.     unsigned long                     Reserved[5];                /* Reserved for PPC, Don't use */
  184.     PPCPortRefNum                     portRefNum;                    /* 38 -->   Port Identifier */
  185.     PPCSessRefNum                     sessRefNum;                    /* 40 <--   Session Reference */
  186.     PPCServiceType                     serviceType;                /* 44 <--   Actual service method (realTime) */
  187.     UInt8                             resFlag;                    /* 45 -->   Must be set to 0  */
  188.     PPCPortPtr                         portName;                    /* 46 -->   Destination portName */
  189.     LocationNamePtr                 locationName;                /* 50 -->   NBP or NAS style service location name */
  190.     unsigned long                     rejectInfo;                    /* 54 <--   reason for rejecting the session request */
  191.     unsigned long                     userData;                    /* 58 -->   Copied to destination PPCInform parameter block */
  192.     unsigned long                     userRefNum;                    /* 62 -->   userRefNum (obtained during login process)  */
  193. };
  194. typedef struct PPCStartPBRec            PPCStartPBRec;
  195.  
  196. typedef PPCStartPBRec *                    PPCStartPBPtr;
  197.  
  198. struct PPCAcceptPBRec {
  199.     Ptr                             qLink;                        /* PPC's Internal Use */
  200.     unsigned short                     csCode;                        /* Requested PPC command */
  201.     unsigned short                     intUse;                        /* Internal Use */
  202.     Ptr                             intUsePtr;                    /* Internal Use */
  203.     PPCCompUPP                         ioCompletion;                /* 12 -->    Completion Routine */
  204.     OSErr                             ioResult;                    /* 16 <--     Command Result Code */
  205.     unsigned long                     Reserved[5];                /* Reserved for PPC, Don't use */
  206.     short                             filler1;
  207.     PPCSessRefNum                     sessRefNum;                    /* 40 -->   Session Reference */
  208. };
  209. typedef struct PPCAcceptPBRec            PPCAcceptPBRec;
  210.  
  211. typedef PPCAcceptPBRec *                PPCAcceptPBPtr;
  212.  
  213. struct PPCRejectPBRec {
  214.     Ptr                             qLink;                        /* PPC's Internal Use */
  215.     unsigned short                     csCode;                        /* Requested PPC command */
  216.     unsigned short                     intUse;                        /* Internal Use */
  217.     Ptr                             intUsePtr;                    /* Internal Use */
  218.     PPCCompUPP                         ioCompletion;                /* 12 -->    Completion Routine */
  219.     OSErr                             ioResult;                    /* 16 <--     Command Result Code */
  220.     unsigned long                     Reserved[5];                /* Reserved for PPC, Don't use */
  221.     short                             filler1;
  222.     PPCSessRefNum                     sessRefNum;                    /* 40 -->   Session Reference */
  223.     short                             filler2;
  224.     long                             filler3;
  225.     long                             filler4;
  226.     unsigned long                     rejectInfo;                    /* 54 -->   reason for rejecting the session request  */
  227. };
  228. typedef struct PPCRejectPBRec            PPCRejectPBRec;
  229.  
  230. typedef PPCRejectPBRec *                PPCRejectPBPtr;
  231.  
  232. struct PPCWritePBRec {
  233.     Ptr                             qLink;                        /* PPC's Internal Use */
  234.     unsigned short                     csCode;                        /* Requested PPC command */
  235.     unsigned short                     intUse;                        /* Internal Use */
  236.     Ptr                             intUsePtr;                    /* Internal Use */
  237.     PPCCompUPP                         ioCompletion;                /* 12 -->    Completion Routine */
  238.     OSErr                             ioResult;                    /* 16 <--     Command Result Code */
  239.     unsigned long                     Reserved[5];                /* Reserved for PPC, Don't use */
  240.     short                             filler1;
  241.     PPCSessRefNum                     sessRefNum;                    /* 40 -->   Session Reference */
  242.     Size                             bufferLength;                /* 44 -->   Length of the message buffer */
  243.     Size                             actualLength;                /* 48 <--   Actual Length Written */
  244.     Ptr                             bufferPtr;                    /* 52 -->   Pointer to message buffer */
  245.     Boolean                         more;                        /* 56 -->   if more data in this block will be written */
  246.     SInt8                             filler2;
  247.     unsigned long                     userData;                    /* 58 -->   Message block userData Uninterpreted by PPC */
  248.     OSType                             blockCreator;                /* 62 -->   Message block creator Uninterpreted by PPC */
  249.     OSType                             blockType;                    /* 66 -->   Message block type Uninterpreted by PPC */
  250. };
  251. typedef struct PPCWritePBRec            PPCWritePBRec;
  252.  
  253. typedef PPCWritePBRec *                    PPCWritePBPtr;
  254.  
  255. struct PPCReadPBRec {
  256.     Ptr                             qLink;                        /* PPC's Internal Use */
  257.     unsigned short                     csCode;                        /* Requested PPC command */
  258.     unsigned short                     intUse;                        /* Internal Use */
  259.     Ptr                             intUsePtr;                    /* Internal Use */
  260.     PPCCompUPP                         ioCompletion;                /* 12 -->    Completion Routine */
  261.     OSErr                             ioResult;                    /* 16 <--     Command Result Code */
  262.     unsigned long                     Reserved[5];                /* Reserved for PPC, Don't use */
  263.     short                             filler1;
  264.     PPCSessRefNum                     sessRefNum;                    /* 40 -->   Session Reference */
  265.     Size                             bufferLength;                /* 44 -->   Length of the message buffer */
  266.     Size                             actualLength;                /* 48 <--   Actual length read */
  267.     Ptr                             bufferPtr;                    /* 52 -->   Pointer to message buffer */
  268.     Boolean                         more;                        /* 56 <--   if true more data in this block to be read */
  269.     SInt8                             filler2;
  270.     unsigned long                     userData;                    /* 58 <--   Message block userData Uninterpreted by PPC */
  271.     OSType                             blockCreator;                /* 62 <--   Message block creator Uninterpreted by PPC */
  272.     OSType                             blockType;                    /* 66 <--   Message block type Uninterpreted by PPC */
  273. };
  274. typedef struct PPCReadPBRec                PPCReadPBRec;
  275.  
  276. typedef PPCReadPBRec *                    PPCReadPBPtr;
  277.  
  278. struct PPCEndPBRec {
  279.     Ptr                             qLink;                        /* PPC's Internal Use */
  280.     unsigned short                     csCode;                        /* Requested PPC command */
  281.     unsigned short                     intUse;                        /* Internal Use */
  282.     Ptr                             intUsePtr;                    /* Internal Use */
  283.     PPCCompUPP                         ioCompletion;                /* 12 -->    Completion Routine */
  284.     OSErr                             ioResult;                    /* 16 <--     Command Result Code */
  285.     unsigned long                     Reserved[5];                /* Reserved for PPC, Don't use */
  286.     short                             filler1;
  287.     PPCSessRefNum                     sessRefNum;                    /* 40 -->   Session Reference */
  288. };
  289. typedef struct PPCEndPBRec                PPCEndPBRec;
  290.  
  291. typedef PPCEndPBRec *                    PPCEndPBPtr;
  292.  
  293. struct PPCClosePBRec {
  294.     Ptr                             qLink;                        /* PPC's Internal Use */
  295.     unsigned short                     csCode;                        /* Requested PPC command */
  296.     unsigned short                     intUse;                        /* Internal Use */
  297.     Ptr                             intUsePtr;                    /* Internal Use */
  298.     PPCCompUPP                         ioCompletion;                /* 12 -->    Completion Routine */
  299.     OSErr                             ioResult;                    /* 16 <--     Command Result Code */
  300.     unsigned long                     Reserved[5];                /* Reserved for PPC, Don't use */
  301.     PPCPortRefNum                     portRefNum;                    /* 38 -->   Port Identifier */
  302. };
  303. typedef struct PPCClosePBRec            PPCClosePBRec;
  304.  
  305. typedef PPCClosePBRec *                    PPCClosePBPtr;
  306.  
  307. struct IPCListPortsPBRec {
  308.     Ptr                             qLink;                        /* PPC's Internal Use */
  309.     unsigned short                     csCode;                        /* Requested PPC command */
  310.     unsigned short                     intUse;                        /* Internal Use */
  311.     Ptr                             intUsePtr;                    /* Internal Use */
  312.     PPCCompUPP                         ioCompletion;                /* 12 -->    Completion Routine */
  313.     OSErr                             ioResult;                    /* 16 <--     Command Result Code */
  314.     unsigned long                     Reserved[5];                /* Reserved for PPC, Don't use */
  315.     short                             filler1;
  316.     unsigned short                     startIndex;                    /* 40 -->   Start Index */
  317.     unsigned short                     requestCount;                /* 42 -->   Number of entries to be returned */
  318.     unsigned short                     actualCount;                /* 44 <--   Actual Number of entries to be returned */
  319.     PPCPortPtr                         portName;                    /* 46 -->   PortName Match */
  320.     LocationNamePtr                 locationName;                /* 50 -->   NBP or NAS type name to locate the Port Location */
  321.     PortInfoArrayPtr                 bufferPtr;                    /* 54 -->   Pointer to a buffer requestCount*sizeof(PortInfo) bytes big */
  322. };
  323. typedef struct IPCListPortsPBRec        IPCListPortsPBRec;
  324.  
  325. typedef IPCListPortsPBRec *                IPCListPortsPBPtr;
  326.  
  327. union PPCParamBlockRec {
  328.     PPCOpenPBRec                     openParam;
  329.     PPCInformPBRec                     informParam;
  330.     PPCStartPBRec                     startParam;
  331.     PPCAcceptPBRec                     acceptParam;
  332.     PPCRejectPBRec                     rejectParam;
  333.     PPCWritePBRec                     writeParam;
  334.     PPCReadPBRec                     readParam;
  335.     PPCEndPBRec                     endParam;
  336.     PPCClosePBRec                     closeParam;
  337.     IPCListPortsPBRec                 listPortsParam;
  338. };
  339.  
  340. /*  PPC Calling Conventions  */
  341.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  342.                                                                                             #pragma parameter __D0 PPCInit
  343.                                                                                             #endif
  344. EXTERN_API( OSErr )
  345. PPCInit                            (void)                                                        TWOWORDINLINE(0x7000, 0xA0DD);
  346.  
  347.  
  348.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  349.                                                                                             #pragma parameter __D0 PPCOpenSync(__A0)
  350.                                                                                             #endif
  351. EXTERN_API( OSErr )
  352. PPCOpenSync                        (PPCOpenPBPtr             pb)                                    TWOWORDINLINE(0x7001, 0xA0DD);
  353.  
  354.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  355.                                                                                             #pragma parameter __D0 PPCOpenAsync(__A0)
  356.                                                                                             #endif
  357. EXTERN_API( OSErr )
  358. PPCOpenAsync                    (PPCOpenPBPtr             pb)                                    TWOWORDINLINE(0x7001, 0xA4DD);
  359.  
  360.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  361.                                                                                             #pragma parameter __D0 PPCInformSync(__A0)
  362.                                                                                             #endif
  363. EXTERN_API( OSErr )
  364. PPCInformSync                    (PPCInformPBPtr         pb)                                    TWOWORDINLINE(0x7003, 0xA0DD);
  365.  
  366.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  367.                                                                                             #pragma parameter __D0 PPCInformAsync(__A0)
  368.                                                                                             #endif
  369. EXTERN_API( OSErr )
  370. PPCInformAsync                    (PPCInformPBPtr         pb)                                    TWOWORDINLINE(0x7003, 0xA4DD);
  371.  
  372.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  373.                                                                                             #pragma parameter __D0 PPCStartSync(__A0)
  374.                                                                                             #endif
  375. EXTERN_API( OSErr )
  376. PPCStartSync                    (PPCStartPBPtr             pb)                                    TWOWORDINLINE(0x7002, 0xA0DD);
  377.  
  378.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  379.                                                                                             #pragma parameter __D0 PPCStartAsync(__A0)
  380.                                                                                             #endif
  381. EXTERN_API( OSErr )
  382. PPCStartAsync                    (PPCStartPBPtr             pb)                                    TWOWORDINLINE(0x7002, 0xA4DD);
  383.  
  384.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  385.                                                                                             #pragma parameter __D0 PPCAcceptSync(__A0)
  386.                                                                                             #endif
  387. EXTERN_API( OSErr )
  388. PPCAcceptSync                    (PPCAcceptPBPtr         pb)                                    TWOWORDINLINE(0x7004, 0xA0DD);
  389.  
  390.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  391.                                                                                             #pragma parameter __D0 PPCAcceptAsync(__A0)
  392.                                                                                             #endif
  393. EXTERN_API( OSErr )
  394. PPCAcceptAsync                    (PPCAcceptPBPtr         pb)                                    TWOWORDINLINE(0x7004, 0xA4DD);
  395.  
  396.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  397.                                                                                             #pragma parameter __D0 PPCRejectSync(__A0)
  398.                                                                                             #endif
  399. EXTERN_API( OSErr )
  400. PPCRejectSync                    (PPCRejectPBPtr         pb)                                    TWOWORDINLINE(0x7005, 0xA0DD);
  401.  
  402.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  403.                                                                                             #pragma parameter __D0 PPCRejectAsync(__A0)
  404.                                                                                             #endif
  405. EXTERN_API( OSErr )
  406. PPCRejectAsync                    (PPCRejectPBPtr         pb)                                    TWOWORDINLINE(0x7005, 0xA4DD);
  407.  
  408.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  409.                                                                                             #pragma parameter __D0 PPCWriteSync(__A0)
  410.                                                                                             #endif
  411. EXTERN_API( OSErr )
  412. PPCWriteSync                    (PPCWritePBPtr             pb)                                    TWOWORDINLINE(0x7006, 0xA0DD);
  413.  
  414.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  415.                                                                                             #pragma parameter __D0 PPCWriteAsync(__A0)
  416.                                                                                             #endif
  417. EXTERN_API( OSErr )
  418. PPCWriteAsync                    (PPCWritePBPtr             pb)                                    TWOWORDINLINE(0x7006, 0xA4DD);
  419.  
  420.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  421.                                                                                             #pragma parameter __D0 PPCReadSync(__A0)
  422.                                                                                             #endif
  423. EXTERN_API( OSErr )
  424. PPCReadSync                        (PPCReadPBPtr             pb)                                    TWOWORDINLINE(0x7007, 0xA0DD);
  425.  
  426.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  427.                                                                                             #pragma parameter __D0 PPCReadAsync(__A0)
  428.                                                                                             #endif
  429. EXTERN_API( OSErr )
  430. PPCReadAsync                    (PPCReadPBPtr             pb)                                    TWOWORDINLINE(0x7007, 0xA4DD);
  431.  
  432.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  433.                                                                                             #pragma parameter __D0 PPCEndSync(__A0)
  434.                                                                                             #endif
  435. EXTERN_API( OSErr )
  436. PPCEndSync                        (PPCEndPBPtr             pb)                                    TWOWORDINLINE(0x7008, 0xA0DD);
  437.  
  438.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  439.                                                                                             #pragma parameter __D0 PPCEndAsync(__A0)
  440.                                                                                             #endif
  441. EXTERN_API( OSErr )
  442. PPCEndAsync                        (PPCEndPBPtr             pb)                                    TWOWORDINLINE(0x7008, 0xA4DD);
  443.  
  444.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  445.                                                                                             #pragma parameter __D0 PPCCloseSync(__A0)
  446.                                                                                             #endif
  447. EXTERN_API( OSErr )
  448. PPCCloseSync                    (PPCClosePBPtr             pb)                                    TWOWORDINLINE(0x7009, 0xA0DD);
  449.  
  450.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  451.                                                                                             #pragma parameter __D0 PPCCloseAsync(__A0)
  452.                                                                                             #endif
  453. EXTERN_API( OSErr )
  454. PPCCloseAsync                    (PPCClosePBPtr             pb)                                    TWOWORDINLINE(0x7009, 0xA4DD);
  455.  
  456.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  457.                                                                                             #pragma parameter __D0 IPCListPortsSync(__A0)
  458.                                                                                             #endif
  459. EXTERN_API( OSErr )
  460. IPCListPortsSync                (IPCListPortsPBPtr         pb)                                    TWOWORDINLINE(0x700A, 0xA0DD);
  461.  
  462.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  463.                                                                                             #pragma parameter __D0 IPCListPortsAsync(__A0)
  464.                                                                                             #endif
  465. EXTERN_API( OSErr )
  466. IPCListPortsAsync                (IPCListPortsPBPtr         pb)                                    TWOWORDINLINE(0x700A, 0xA4DD);
  467.  
  468. EXTERN_API( OSErr )
  469. DeleteUserIdentity                (unsigned long             userRef);
  470.  
  471. EXTERN_API( OSErr )
  472. GetDefaultUser                    (unsigned long *        userRef,
  473.                                  Str32                     userName);
  474.  
  475. EXTERN_API( OSErr )
  476. StartSecureSession                (PPCStartPBPtr             pb,
  477.                                  Str32                     userName,
  478.                                  Boolean                 useDefault,
  479.                                  Boolean                 allowGuest,
  480.                                  Boolean *                guestSelected,
  481.                                  ConstStr255Param         prompt);
  482.  
  483. typedef CALLBACK_API( Boolean , PPCFilterProcPtr )(LocationNamePtr name, PortInfoPtr port);
  484. typedef STACK_UPP_TYPE(PPCFilterProcPtr)                         PPCFilterUPP;
  485. enum { uppPPCCompProcInfo = 0x000000C0 };                         /* pascal no_return_value Func(4_bytes) */
  486. enum { uppPPCFilterProcInfo = 0x000003D0 };                     /* pascal 1_byte Func(4_bytes, 4_bytes) */
  487. #define NewPPCCompProc(userRoutine)                             (PPCCompUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppPPCCompProcInfo, GetCurrentArchitecture())
  488. #define NewPPCFilterProc(userRoutine)                             (PPCFilterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppPPCFilterProcInfo, GetCurrentArchitecture())
  489. #define CallPPCCompProc(userRoutine, pb)                         CALL_ONE_PARAMETER_UPP((userRoutine), uppPPCCompProcInfo, (pb))
  490. #define CallPPCFilterProc(userRoutine, name, port)                 CALL_TWO_PARAMETER_UPP((userRoutine), uppPPCFilterProcInfo, (name), (port))
  491. EXTERN_API( OSErr )
  492. PPCBrowser                        (ConstStr255Param         prompt,
  493.                                  ConstStr255Param         applListLabel,
  494.                                  Boolean                 defaultSpecified,
  495.                                  LocationNameRec *        theLocation,
  496.                                  PortInfoRec *            thePortInfo,
  497.                                  PPCFilterUPP             portFilter,
  498.                                  ConstStr32Param         theLocNBPType)                        THREEWORDINLINE(0x303C, 0x0D00, 0xA82B);
  499.  
  500.  
  501. /*
  502.   The ParamBlock calls with the "Sync" or "Async" suffix are being phased out.
  503. */
  504. #define PPCOpen(pb, async)      ((async) ? PPCOpenAsync(pb)      : PPCOpenSync(pb))
  505. #define PPCInform(pb, async)    ((async) ? PPCInformAsync(pb)    : PPCInformSync(pb))
  506. #define PPCStart(pb, async)     ((async) ? PPCStartAsync(pb)     : PPCStartSync(pb))
  507. #define PPCAccept(pb, async)    ((async) ? PPCAcceptAsync(pb)    : PPCAcceptSync(pb))
  508. #define PPCReject(pb, async)    ((async) ? PPCRejectAsync(pb)    : PPCRejectSync(pb))
  509. #define PPCWrite(pb, async)     ((async) ? PPCWriteAsync(pb)     : PPCWriteSync(pb))
  510. #define PPCRead(pb, async)      ((async) ? PPCReadAsync(pb)      : PPCReadSync(pb))
  511. #define PPCEnd(pb, async)       ((async) ? PPCEndAsync(pb)       : PPCEndSync(pb))
  512. #define PPCClose(pb, async)     ((async) ? PPCCloseAsync(pb)     : PPCCloseSync(pb))
  513. #define IPCListPorts(pb, async) ((async) ? IPCListPortsAsync(pb) : IPCListPortsSync(pb))
  514.  
  515.  
  516.  
  517. #if PRAGMA_STRUCT_ALIGN
  518.     #pragma options align=reset
  519. #elif PRAGMA_STRUCT_PACKPUSH
  520.     #pragma pack(pop)
  521. #elif PRAGMA_STRUCT_PACK
  522.     #pragma pack()
  523. #endif
  524.  
  525. #ifdef PRAGMA_IMPORT_OFF
  526. #pragma import off
  527. #elif PRAGMA_IMPORT
  528. #pragma import reset
  529. #endif
  530.  
  531. #ifdef __cplusplus
  532. }
  533. #endif
  534.  
  535. #endif /* __PPCTOOLBOX__ */
  536.  
  537.